//为count生成action
// function createIncrementAction(data){
//     return {type:'increment',data}
// }
import {INCREMENT,DECREMENT} from '../redux/constant'
//同步返回对象
export const createIncrementAction=data=>({type:INCREMENT,data})
export const createDecrementAction=data=>({type:DECREMENT,data})
//异步action是返回值为函数
export const createIncrementAsyncAction=(data,time)=>{
    return (dispatch)=>{
      setTimeout(()=>{
        dispatch(createIncrementAction(data))
      },time)
    }
}
// function createDecrementAction(data){
//     return {type:'decrement',data}
// }